package com.scpii.universal.struts.manage;

import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import javax.imageio.ImageIO;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.xwork.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.doone.comm.paginaction.Pagination;
import com.scpii.universal.action.BaseAction;
import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.dto.AppContentDto;
import com.scpii.universal.dto.AttributeAndOptionsDto;
import com.scpii.universal.dto.AttributeDto;
import com.scpii.universal.dto.CommentDto;
import com.scpii.universal.dto.ContentImgDto;
import com.scpii.universal.dto.EnterShopDto;
import com.scpii.universal.dto.PageModuleDetailDto;
import com.scpii.universal.dto.ShopPOJO;
import com.scpii.universal.hibernate.entity.AppDetailPageModuleTab;
import com.scpii.universal.hibernate.entity.AttributeListTab;
import com.scpii.universal.hibernate.entity.AttributeTab;
import com.scpii.universal.hibernate.entity.CatelogTab;
import com.scpii.universal.hibernate.entity.ContentImgTab;
import com.scpii.universal.hibernate.entity.ContentTab;
import com.scpii.universal.hibernate.entity.EnterpShopTab;
import com.scpii.universal.hibernate.entity.WebMenuTab;
import com.scpii.universal.pns.dto.EcProductDto;
import com.scpii.universal.pns.dto.ProductCotent;
import com.scpii.universal.pns.entity.EcProduct;
import com.scpii.universal.pns.entity.Tags;
import com.scpii.universal.pns.service.EcProductService;
import com.scpii.universal.pns.service.ResourcesService;
import com.scpii.universal.service.AppContentService;
import com.scpii.universal.service.AttributeListService;
import com.scpii.universal.service.CatelogService;
import com.scpii.universal.service.ContentImgService;
import com.scpii.universal.service.ContentService;
import com.scpii.universal.service.EnterShopManageService;
import com.scpii.universal.service.EnterpShopService;
import com.scpii.universal.service.WebMenuService;
import com.scpii.universal.util.EhCacheManager;
import com.scpii.universal.util.FileUploadUtil;
import com.scpii.universal.util.ImgAndFilePath;
import com.scpii.universal.util.StreamUtil;

/**
 * 
 * universalWeb
 * 
 * @author zhangqiang 2012-7-7下午11:47:03
 */
@Controller
@Scope("prototype")
public class DataBindingAction extends BaseAction {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 4629317011625914415L;

	@Resource
	private WebMenuService webMenuService;
	@Resource
	private CatelogService catelogService;
	@Resource
	private AppContentService appContentService;
	@Resource
	private ContentService contentService;
	@Resource
	private ContentImgService contentImgService;
	@Resource
	private AttributeListService attributeListService;
	@Resource
	private EcProductService ecProduceService;
	@Resource
	private ResourcesService resourcesService;
	@Resource
	private EnterShopManageService enterShopManageService;
	@Resource
	private EnterpShopService enterpShopService;

	// 分页信息
	private Pagination page = new Pagination();
	private Pagination pageContent;
	// 上传的文件流
	private File myFile;
	// 上传文件的文件名称
	private String myFileFileName;

	// 内容缩略图
	private File titleFile;

	private String titleFileFileName;

	// 多图片上传
	private List<ContentImgDto> contentImg;
	// 分类信息list
	private List<CatelogTab> catelogList;
	// 叶子节点的详细信息 详细内容
	private List<AppContentDto> appContentList;
	// 分类信息封装
	private CatelogTab catelogTab;
	// 分类信息ID
	private String intCateId;
	// 类容ID
	private Integer intContentId;

	// 分类信息的封装
	private ContentTab contentTab;

	// 内容图片信息的封装
	private List<ContentImgTab> imgList;
	// 分类属性信息
	private List<AttributeDto> attList;
	// 分类属性信息
	private List<AttributeTab> atList;
	// 评论信息
	private List<CommentDto> commentList;

	// 分类信息list

	private List<PageModuleDetailDto> pageList;

	// 页面所有模块的list
	private List<AppDetailPageModuleTab> pageMpoduleList;

	//属性列表
	private List<AttributeListTab> attriListList;
	// xiang
	private String modules;

	private ContentImgDto downLoadDto;

	private ContentImgTab downLoadtab;
	private int imgWidth;
	private int imgHeight;
	private int imgSize;
	private List<AttributeAndOptionsDto> lstAttrAndOpt;
	private String clientRequestType;
	private EcProductDto ecProductDto = new EcProductDto();
	private List<EcProductDto> products;
	private Long productId;
	private EnterShopDto condition;
	private List<EnterShopDto> shopList;
	
	private EnterpShopTab enterpShopTab;
	private String newTagsContainer;
	private String selectedTagsContainer="";
	private String delTagsContainer;
	private List<Tags> usedTags;
	private Integer intShopId;
	private int showAll=0;


	public String goEcEdit() {
		String fromUrl = request.getParameter("fromUrl");
		if ("add".equals(fromUrl)) {
			initAddAttrs();
			EcProduct product = new EcProduct();
			product.setPaymentType((short) 9);
			product.setIsReal((short) 1);
			ecProductDto.setEcProduct(product);
			populateColumnAilas(EcProduct.COLUMN_ALIAS);
		} else {
			EcProduct product = ecProduceService.get(productId);
			ecProductDto.setEcProduct(product);
			// 返回分类的属性信息
			attList = appContentService.getAttribyteById(intContentId);
			//查询区域列表属性列表
			lstAttrAndOpt = new ArrayList<AttributeAndOptionsDto>();
			AttributeAndOptionsDto attributeAndOptionsDto = null;
			AttributeTab attr = null;
			for (AttributeDto attributeDto : attList) {
				attributeAndOptionsDto = new AttributeAndOptionsDto();
				attributeAndOptionsDto.setAttributeDto(attributeDto);
				if( attributeDto.getIntInputType() == GenericConstants.ATTRIBUTE_INPUT_TYPE_SELECT){
					attributeAndOptionsDto.setOptions(attributeListService.getAttributeListByAttrType(attributeDto.getIntType()));
				}
				attr = new AttributeTab();
				BeanUtils.copyProperties(attributeDto, attr);
				attributeAndOptionsDto.setAttributeTab(attr);
				lstAttrAndOpt.add(attributeAndOptionsDto);
				
			}
			//预览图
			ecProductDto.setResources(resourcesService.getAllByTargerId(productId));
			//字段别名
			populateColumnAilas(product.getColumnAlias());
			populateContent(product.getBody());
			this.setIntCateId(product.getCatId().toString());
			ecProductDto.setIntContentId(intContentId);
		}
		return SUCCESS;
	}
	
	private void populateContent(String data) {
		if (StringUtils.isBlank(data))
			return;
		JSONArray datas = JSONArray.fromObject(data);
		ProductCotent content = null;
		List<ProductCotent> contents = new ArrayList<ProductCotent>();
		for (Object object : datas) {
			content = (ProductCotent) JSONObject.toBean(JSONObject.fromObject(object),ProductCotent.class);
			contents.add(content);
		}
		ecProductDto.setContents(contents);
	}
	
	private void populateColumnAilas(String data){
		JSONObject jo = JSONObject.fromObject(data);
		ecProductDto.setListPriceName(jo.getString("listPrice"));
		ecProductDto.setPriceName(jo.getString("price"));
		ecProductDto.setRatingAvgName(jo.getString("ratingAvg"));
		ecProductDto.setReviewsCountName(jo.getString("reviewsCount"));
		ecProductDto.setOrderCountName(jo.getString("orderCount"));
		ecProductDto.setFavCountName(jo.getString("favCount"));
		ecProductDto.setCommentCountName(jo.getString("commentCount"));
	}
	
	public String doEcSave() {
		ecProductDto.setIntCateId(Long.parseLong(intCateId));
		ecProduceService.saveProduct(ecProductDto,attList, getUserInfo());
		return SUCCESS;
	}
	
	/**
	 * 取得后台管理模块的树结构
	 * 
	 * @return
	 * @throws IOException
	 * @author zhangqiang 2012-7-8上午01:03:23
	 */
	public String getBackStageTree() throws IOException {

		List<WebMenuTab> webMenuList = webMenuService.getTreeData();
		// 设置编码格式
		response.setCharacterEncoding("utf-8");
		// 将数据转换成前台js array格式的数据
		response.getWriter().print(
				JSONArray.fromObject(this.assembleTreeData(webMenuList)));

		return null;
	}

	/**
	 * 取得分类管理模块的树结构
	 * 
	 * @return
	 * @throws IOException
	 * @author zhangqiang 2012-7-8上午01:03:23
	 */
	public String getAppCatlogTree() throws IOException {

		List<CatelogTab> catelogList = catelogService.getTreeData(getUserInfo()
				.getAppId());
		// 设置编码格式
		response.setCharacterEncoding("utf-8");
		// 将数据转换成前台js array格式的数据
		response.getWriter().print(
				JSONArray.fromObject(this
						.assembleAppContentTreeData(catelogList)));

		return null;
	}

	/**
	 * 根据树节点Id 查找树的子节点信息
	 * 
	 * @return
	 * @author zhangqiang 2012-7-9下午04:57:54
	 */
	public String getAppCatelogById() {
		// 获取分类id
		String treeid = request.getParameter("id");
		// 获取返回信息的条数
		Integer recordCount = catelogService.getCountById(treeid);
		// 判断第一次进入分页信息
		if (getSelectPerPage("page") == -1) {
			page.setPageRecord(GenericConstants.PAGE_NO);
		} else {
			page.setPageRecord(getSelectPerPage("page"));
		}
		// 判断是否是第一次查询
		if (getQueryFlag("page") == -1) {
			page.setTotalRecord(recordCount);
		} else {
			page.setTotalRecord(getQueryFlag("page"));
		}
		setPageParameters(page, "page");
		// 如果是叶子节点 这需要查找内容表 显示内容
		// 通过便利查询
		// 获取树的子节点信息
		catelogList = catelogService.getChildrenTreeById(treeid,
				page.getCurrentPage(), page.getPageRecord());

		// for(CatelogTab dto:catelogList){
		// dto.setVarCateImgUrl(""+GenericConstants.WEB_URL+dto.getVarCateImgUrl()+"");

		// }
		// UserInfoDto
		// user=(UserInfoDto)session.getAttribute(GenericConstants.USER_INFO);

		return SUCCESS;

	}

	/**
	 * 查找叶子节点的详细信息
	 * 
	 * @return
	 * @author zhangqiang 2012-7-9下午04:57:54
	 */
	public String getAppContent() {
		if (pageContent == null) {
			pageContent = new Pagination();

		}
		intCateId = request.getParameter("intCateId");
		CatelogTab cat = catelogService.get(Integer.parseInt(intCateId));
		catelogTab=cat;
		// 判断第一次进入分页信息
		if (getSelectPerPage("pageContent") == -1) {
			pageContent.setPageRecord(GenericConstants.PAGE_NO_10);
		} else {
			pageContent.setPageRecord(getSelectPerPage("pageContent"));
		}
		initShopCondition(cat.getIntType());
		// 判断是否是第一次查询
		if (getQueryFlag("pageContent") == -1) {
			if (cat.getIntType() == 8) {
				//电商
				pageContent.setTotalRecord(ecProduceService.getTotalCountByCateId(
						Long.parseLong(intCateId), GenericConstants.APP_ID_PRE
								+ (long) getUserInfo().getAppId()).intValue());
			} else if (cat.getIntType() == 9) {
				//门店
				pageContent.setTotalRecord(enterShopManageService.getCountByCondition(condition,"c"));
			} else {
				pageContent.setTotalRecord(appContentService.getCountById(intCateId, getUserInfo().getAppId()));
			}
		} else {
			pageContent.setTotalRecord(getQueryFlag("pageContent"));
		}
		if(showAll==1){
			pageContent.setPageRecord(pageContent.getTotalRecord());
		}
		setPageParameters(pageContent, "pageContent");
		
		//判断分类类型
		if(cat.getIntType()==8){
			products = ecProduceService.getAllByCateId(Long.parseLong(intCateId), GenericConstants.APP_ID_PRE
					+ (long) getUserInfo().getAppId(), pageContent.getCurrentPage(), pageContent.getPageRecord());
			return "ec";
		} else if (cat.getIntType()==9) {
			populateSearchTags();
			shopList = enterShopManageService.getEnterShopList(condition,"c",pageContent.getCurrentPage(), pageContent.getPageRecord());
			return "shop";
		} else {
			populateContentList(intCateId);
			return SUCCESS;
		}

	}
	
	private void populateSearchTags() {
		usedTags =  enterpShopService.getTagsAndUseNum(GenericConstants.CATE_ID_PRE + Integer.parseInt(intCateId));
		if(condition != null && condition.getTags() != null){
			for (Tags tag : usedTags) {
				if (condition.getTags().contains(tag.getId().toString())){
					tag.setStatus(1);
				}
			}
		}
	}

	private void populateContentList(String intCateId) {
		// 获取树的子节点信息
		appContentList = appContentService.getAppContentById(
				Integer.parseInt(intCateId), getUserInfo().getAppId(),
				pageContent.getCurrentPage(), pageContent.getPageRecord());
		//查询区域列表属性列表
		attriListList = attributeListService.getAttributeListByAttrType(GenericConstants.HOUSE_AREA);
		//查询房价列表
		
		for (AppContentDto dto : appContentList) {
			dto.setVarContentImgUrl(dto.getVarContentImgUrl() == null ? ""
					: (dto.getVarContentImgUrl().startsWith(
							GenericConstants.IMG_RELATIVE_PREFIX) ? getServerURL() + dto.getVarContentImgUrl() : dto
							.getVarContentImgUrl()));
		}
	}
	
	private void initShopCondition(int type) {
		if (condition == null && type == 9) {
			condition = new EnterShopDto();
			condition.setIntContentId(intContentId);
			//设置门店列表关联的内容ID到Session中
			session.setAttribute("enterpShopContentId",intContentId);
			condition.setIntAppId(getUserInfo().getAppId());
			condition.setIntEnterpId(getUserInfo().getIntEnterpId());
			condition.setIntCateId(Integer.parseInt(intCateId));
			condition.setVarShopName("请输入门店名称或地址");
		}
	}

	/**
	 * 返回需要编辑的分类信息
	 * 
	 * @return
	 * @author zhangqiang 2012-7-11下午04:02:59
	 * @throws IOException 
	 */
	public String getCatelog() throws IOException {

		catelogTab = catelogService.get(Integer.parseInt(intCateId));
		catelogTab.setVarCateImgUrl(getServerURL()
				+ catelogTab.getVarCateImgUrl());
		initImgRule(Integer.parseInt(intCateId),0);
		JSONObject datas = new JSONObject();
		datas.put("intCateId", intCateId);
		datas.put("intParentCateId", catelogTab.getIntParentCateId());
		datas.put("varCateName", catelogTab.getVarCateName());
		datas.put("varCateImgUrl", catelogTab.getVarCateImgUrl());
		datas.put("imgWidth", imgWidth);
		datas.put("imgHeight", imgHeight);
		datas.put("imgSize", imgSize);
		jsonOut(datas.toString());
		return null;

	}

	/**
	 * 保存编辑的信息
	 * 
	 * @return
	 * @author zhangqiang 2012-7-12上午09:26:22
	 */
	public String editCatelogInfo() {
		// 得到保存图片的路径
		String filePath = "";
		if (myFile != null) {
			// 创建图片资源目录
			// ImgAndFilePath.createWorkPic(getWebAppsRealPath(), getUserInfo()
			// .getIntEnterpId(), getUserInfo().getAppId());
			// 文件上櫥绝对路径
			String imgAbsolutePath = getImgBasePath()
			// + ImgAndFilePath.ENTERP_ANDROID
					+ ImgAndFilePath.ENTERP_CATELOG + File.separator;
			String pictureName = FileUploadUtil.generateIconName() + ".jpg";
			StreamUtil.uploadActiveImgs(myFile, getWebAppsRealPath()
					+ imgAbsolutePath + pictureName);
			/*FileUploadUtil.compressPic(getWebAppsRealPath()
					+ imgAbsolutePath + pictureName, myFile, imgWidth, imgHeight);*/
			filePath = imgAbsolutePath + pictureName;
		}
		// 文件保存成功 开始更改数据库
		CatelogTab catTab = catelogService.get(catelogTab.getIntCateId());

		if (myFile != null) {
			if (!StringUtils.isBlank(catTab.getVarCateImgUrl())){
				// 删除以前的图片
				File newFile = new File(catTab.getVarCateImgUrl());
				if (newFile.exists()) {
					newFile.delete();
				}
			}
			// 文件路劲
			catTab.setVarCateImgUrl((filePath).replace("\\", "/"));
		}

		catTab.setVarCateName(catelogTab.getVarCateName());

		catelogService.update(catTab);

		return SUCCESS;

	}

	/**
	 * 跳转到详情页面
	 * 
	 * @return
	 * @author zhangqiang 2012-7-23下午01:24:14
	 */
	public String goContentDetail() {
		// 返回类容的基本信息
		contentTab = contentService.get(intContentId);
		// 控制空格换行
		if (contentTab.getVarContentDescript() != null && contentTab.getIntResourceId() == 0){
			contentTab.setVarContentDescript(contentTab.getVarContentDescript()
					.trim().replaceAll("\r\n", "<br/>")
					.replaceAll(" ", "&nbsp;&nbsp;"));
		}
		if (contentTab.getVarContentImgUrl() != null){
			if (contentTab.getVarContentImgUrl().startsWith(GenericConstants.IMG_RELATIVE_PREFIX)){
				contentTab.setVarContentImgUrl(getServerURL()
						+ contentTab.getVarContentImgUrl());
			}
		}
		// 返回分类的属性信息
		List<AttributeDto> lstAttr = appContentService.getAttribyteById(intContentId);
		attList = new ArrayList<AttributeDto>();
		for (int i = 0; i < lstAttr.size(); i++) {
			//属性值为空的不显示
			if (!StringUtils.isBlank(lstAttr.get(i).getVarAttriValue())) {
				attList.add(lstAttr.get(i));
			}
		}
		
		// 返回图片信息
//		List<ContentImgTab> pictureList = contentImgService
//				.getImgListById(intContentId);
		// 返回图片信息
		List<ContentImgTab> pictureList = contentImgService.getImgListByIdImgType(intContentId,GenericConstants.CONTENT_IMG_TYPE_PHOTO);
		//获取下载地址类型  0:android  1:ios
		String downLoadType=request.getParameter("downLoadType");
		this.setClientRequestType(downLoadType);
		// 修改图片地址
		if (pictureList != null && pictureList.size() > 0) {
			for (ContentImgTab tab : pictureList) {
				if (tab.getVarImgDescrip() != null){
					tab.setVarImgDescrip(tab.getVarImgDescrip()
							.trim().replaceAll("\r\n", "<br/>")
							.replaceAll(" ", "&nbsp;&nbsp;"));
				}
				// 区分下载和图片
				if (tab.getIntType() == 4) {
					if (downLoadDto == null) {
						downLoadDto = new ContentImgDto();
					}

					if (tab.getVarImgName() != null
							&& !"".equals(tab.getVarImgName())) {
						String[] appType = tab.getVarImgName().split(",");
						
						if (downLoadType != null && !downLoadType.equals("")
								&& appType != null && appType.length > 0) {
							// 如果是Apple的客户端请求这个网页地址
							if ("1".equals(downLoadType)) {
								downLoadDto.setDownloadUrl(appType[1]);

							} else if ("0".equals(downLoadType)) {// 如果是Android的系统客户端请求这个网页地址
								downLoadDto.setDownloadUrl(appType[0]);
							}
						}

						downLoadDto.setDownloadImgUrl(getServerURL()
								+ tab.getVarImgUrl());
					}

				} else {
					tab.setVarImgUrl(getServerURL()
							+ tab.getVarImgUrl());
					if (imgList == null) {
						imgList = new ArrayList<ContentImgTab>();
					}
					imgList.add(tab);
				}
			}
		}
		// 返回评论信息
		commentList = appContentService.getCommentListById(intContentId);
		// 返回详情页面模块显示循序
		pageMpoduleList = appContentService.getPageModuleById(contentTab
				.getIntCateId());
		return SUCCESS;
	}

	/**
	 * 模块编辑页面预览
	 * 
	 * @return
	 * @author zhangqiang 2012-8-1下午02:03:43
	 */
	public String goPreViewDetail() {
		// 用于预览的数据ID TODO
		intContentId = Integer.parseInt(bundle.getString("contentDetail.previw.contentId"));
		// 返回类容的基本信息
		contentTab = contentService.get(intContentId);
		contentTab.setVarContentImgUrl(getServerURL()
				+ contentTab.getVarContentImgUrl());
		// 返回分类的属性信息
		attList = appContentService.getAttribyteById(intContentId);
		// 返回图片信息
		List<ContentImgTab> pictureList = contentImgService
				.getImgListById(intContentId);
		// 修改图片地址
		if (pictureList != null && pictureList.size() > 0) {
			for (ContentImgTab tab : pictureList) {
				// 区分下载和图片
				if (tab.getVarImgDescrip() != null
						&& "-1".equals(tab.getVarImgDescrip().trim())) {
					if (downLoadDto == null) {
						downLoadDto = new ContentImgDto();
					}
					downLoadDto.setDownloadUrl(tab.getVarImgName());
					downLoadDto.setDownloadImgUrl(getServerURL()
							+ tab.getVarImgUrl());
				} else {
					tab.setVarImgUrl(getServerURL()
							+ tab.getVarImgUrl());
					if (imgList == null) {
						imgList = new ArrayList<ContentImgTab>();
					}
					imgList.add(tab);
				}
			}
		}
		// 返回评论信息
		commentList = appContentService.getCommentListById(intContentId);
		// 返回详情页面模块显示循序
		pageMpoduleList = new ArrayList<AppDetailPageModuleTab>();
		String[] module = modules.split(",");
		// 页面编辑的娱预览循序
		int length = module.length;
		// 获取显示页面
		List<AppDetailPageModuleTab> tablist = appContentService
				.getAllPageModule();
		AppDetailPageModuleTab moduleTab = null;
		for (int k = 0; k < length; k++) {
			// 判断是否有值 如果是是-1 跳出笨次循序
			if (null == module[k] || module[k].equals("")) {
				continue;
			}
			for (int i = 0; i < tablist.size(); i++) {
				moduleTab = tablist.get(i);
				if (moduleTab.getIntPageModuleId() == Integer
						.parseInt(module[k])) {
					pageMpoduleList.add(moduleTab);
				}

			}
		}

		return SUCCESS;
	}

	/**
	 * 跳转到添加页面
	 * 
	 * @return
	 * @author zhangqiang 2012-7-23下午08:16:44
	 */
	public String goAddContent(){
		catelogTab = catelogService.get(Integer.parseInt(intCateId));
		//initImgRule(Integer.parseInt(intCateId),1);
		initAddAttrs();
		return SUCCESS;
	}

	private void initAddAttrs() {
		atList = catelogService.getAllAttributesByCateId(Integer.parseInt(intCateId));
		//查询区域列表属性列表
		lstAttrAndOpt = new ArrayList<AttributeAndOptionsDto>();
		AttributeAndOptionsDto attributeAndOptionsDto = null;
		for (AttributeTab attributeTab : atList) {
			attributeAndOptionsDto = new AttributeAndOptionsDto();
			attributeAndOptionsDto.setAttributeTab(attributeTab);
			if( attributeTab.getIntInputType() == GenericConstants.ATTRIBUTE_INPUT_TYPE_SELECT){
				attributeAndOptionsDto.setOptions(attributeListService.getAttributeListByAttrType(attributeTab.getIntType()));
			}
			lstAttrAndOpt.add(attributeAndOptionsDto);
		}
	}
	
	private void initImgRule(int cateId,int type) {
		int[] imgRule = catelogService.getThumbPixelByBindCate(cateId, type);
		imgWidth = imgRule[0];
		imgHeight = imgRule[1];
		imgSize = imgRule[2];
	}
	
	/**
	 * 添加详情信息
	 * 
	 * @return
	 * @author zhangqiang 2012-7-23下午08:16:44
	 * @throws IOException 
	 */
	public String doAddContent() throws IOException {
		String filePath = "";
		if (titleFile != null) {
			// 创建图片资源目录
			// ImgAndFilePath.createWorkPic(getWebAppsRealPath(), getUserInfo()
			// .getIntEnterpId(), getUserInfo().getAppId());
			// 文件上櫥绝对路径
			String imgAbsolutePath = getImgBasePath()
					// + ImgAndFilePath.ENTERP_ANDROID
					+ ImgAndFilePath.ENTERP_CATELOG
					+ ImgAndFilePath.ENTERP_DETAIL + File.separator;
			Image img = ImageIO.read(titleFile);

			String pictureName = FileUploadUtil.generateIconName()+"_"+img.getWidth(null)+"x"+ img.getHeight(null)+ titleFileFileName.substring(titleFileFileName.lastIndexOf("."));
			StreamUtil.uploadActiveImgs(titleFile, getWebAppsRealPath()
					+ imgAbsolutePath + pictureName);
			/*FileUploadUtil.compressPic(getWebAppsRealPath()
					+ imgAbsolutePath + pictureName, titleFile, imgWidth, imgHeight);*/
			filePath = imgAbsolutePath + pictureName;
		}
		if (titleFile != null) {
			// 文件路劲
			contentTab.setVarContentImgUrl((filePath).replace("\\", "/"));
		}
		// 内容图片库处理
		contentImgProcess();
		// 处理下载信息 downLoadDto
		if (downLoadDto.getDownloadUrl() != null
				&& downLoadDto.getUploadFile() != null) {
			// 文件上櫥绝对路径
			String imgAbsolutePath = getImgBasePath()
					// + ImgAndFilePath.ENTERP_ANDROID
					+ ImgAndFilePath.ENTERP_CATELOG
					+ ImgAndFilePath.ENTERP_DETAIL + File.separator;
			String pictureName = FileUploadUtil.generateIconName() + ".jpg";
			/*FileUploadUtil.compressPic(getWebAppsRealPath() + imgAbsolutePath
					+ pictureName, downLoadDto.getUploadFile(),
					GenericConstants.CONTENT_DETAIL_IMG_WIDTH, 0);*/
			StreamUtil.uploadActiveImgs(downLoadDto.getUploadFile(),
					getWebAppsRealPath() + imgAbsolutePath + pictureName);
			// + contentImgDto.getUploadFileFileName());
			filePath = imgAbsolutePath + pictureName;

			ContentImgTab imgTab = new ContentImgTab();
			imgTab.setVarImgUrl((filePath).replace("\\", "/"));
			imgTab.setVarImgName(downLoadDto.getDownloadUrl() + ","
					+ downLoadDto.getIosUrl());
			// -1 代表这是下载的地址
			imgTab.setVarImgDescrip("-1");
			imgTab.setIntType(4);
			// 文件描述
			imgList.add(imgTab);
		}

		// 保存信息
		appContentService.saveContent(getUserInfo(),
				Integer.parseInt(intCateId), contentTab, imgList, attList,
				request.getContextPath());

		return SUCCESS;
	}

	/**
	 * 管理详情页面的模块显示
	 * 
	 * @return
	 * @author zhangqiang 2012-7-25下午03:03:01
	 */
	public String goAddContentModule() {

		// 返回页面模块显示循序
		List<CatelogTab> cateList = catelogService.getAll(getUserInfo());
		List<CatelogTab> cateLogList = new ArrayList<CatelogTab>();
		for (CatelogTab tab : cateList) {
			if (tab.getIntParentCateId() == 0) {
				cateLogList.add(tab);
			}
		}
		pageList = appContentService.getAppPageSort(cateLogList);
		// 查询显示循序

		return SUCCESS;
	}

	/**
	 * 到模块编辑页面
	 * 
	 * @return
	 * @author zhangqiang 2012-7-25下午09:40:30
	 */
	public String goEditContentModule() {
		// 返回页面模块显示循序

		List<CatelogTab> cateLogList = new ArrayList<CatelogTab>();
		CatelogTab tab = new CatelogTab();
		tab.setIntCateId(Integer.parseInt(intCateId));
		cateLogList.add(tab);

		pageList = appContentService.getAppPageSort(cateLogList);
		pageMpoduleList = appContentService.getAllPageModule();
		return SUCCESS;
	}

	/**
	 * 保存用户对详情页面显示模块的调整
	 * 
	 * @return
	 * @author zhangqiang 2012-7-31下午03:30:08
	 */
	public String updateModule() {
		appContentService.updatemodule(modules, Integer.parseInt(intCateId));
		return null;

	}

	/**
	 * 跳转到详情编辑
	 * 
	 * @return
	 * @author zhangqiang 2012-8-4下午03:50:00
	 */
	public String goEditContent() {
		// 返回类容的基本信息
		contentTab = contentService.get(intContentId);
		catelogTab = catelogService.get(Integer.parseInt(intCateId));
		contentTab.setVarContentImgUrl(contentTab.getVarContentImgUrl() == null ? ""
						: (contentTab.getVarContentImgUrl().startsWith(
								GenericConstants.IMG_RELATIVE_PREFIX) ? getServerURL()
								+ contentTab.getVarContentImgUrl() : contentTab
								.getVarContentImgUrl()));
		// 返回分类的属性信息
		initEditAttrs();
		// 返回图片信息
		initImgs();
//		initImgRule(contentTab.getIntCateId(),1);
		return SUCCESS;
	}

	private void initImgs() {
		List<ContentImgTab> pictureList = contentImgService
				.getImgListById(intContentId);
		// 修改图片地址
		if (pictureList != null && pictureList.size() > 0) {
			for (ContentImgTab tab : pictureList) {
				// 区分下载和图片
				if (tab.getVarImgDescrip() != null
						&& "-1".equals(tab.getVarImgDescrip().trim())) {
					if (downLoadDto == null) {
						downLoadDto = new ContentImgDto();
					}
					if (tab.getVarImgName() != null) {
						String[] appType = tab.getVarImgName().split(",");
						if (appType.length > 0) {
							downLoadDto.setDownloadUrl(appType[0]);
							downLoadDto.setIosUrl(appType[1]);
						}
						downLoadDto.setIntImgId(tab.getIntImgId());
						downLoadDto.setDownloadImgUrl(getServerURL()
								+ tab.getVarImgUrl());
					}

				} else {
					tab.setVarImgUrl(getServerURL()
							+ tab.getVarImgUrl());
					if (imgList == null) {
						imgList = new ArrayList<ContentImgTab>();
					}
					imgList.add(tab);
				}
			}
		}
	}

	private void initEditAttrs() {
		attList = appContentService.getAttribyteById(intContentId);
		//查询区域列表属性列表
		lstAttrAndOpt = new ArrayList<AttributeAndOptionsDto>();
		AttributeAndOptionsDto attributeAndOptionsDto = null;
		for (AttributeDto attributeDto : attList) {
			attributeAndOptionsDto = new AttributeAndOptionsDto();
			attributeAndOptionsDto.setAttributeDto(attributeDto);
			if( attributeDto.getIntInputType() == GenericConstants.ATTRIBUTE_INPUT_TYPE_SELECT){
				attributeAndOptionsDto.setOptions(attributeListService.getAttributeListByAttrType(attributeDto.getIntType()));
			}
			lstAttrAndOpt.add(attributeAndOptionsDto);
		}
	}

	/**
	 * 保存详情编辑信息
	 * 
	 * @return
	 * @author zhangqiang 2012-8-5下午08:13:05
	 * @throws IOException 
	 */
	public String doEditContent() throws IOException {
		String filePath = "";
		if (titleFile != null) {
			// 创建图片资源目录
			// ImgAndFilePath.createWorkPic(getWebAppsRealPath(), getUserInfo()
			// .getIntEnterpId(), getUserInfo().getAppId());
			// 文件上櫥绝对路径
			String imgAbsolutePath = getImgBasePath()
					// + ImgAndFilePath.ENTERP_ANDROID
					+ ImgAndFilePath.ENTERP_CATELOG
					+ ImgAndFilePath.ENTERP_DETAIL + File.separator;
			Image img = ImageIO.read(titleFile);
			String pictureName = FileUploadUtil.generateIconName()+"_"+img.getWidth(null)+"x"+ img.getHeight(null) + titleFileFileName.substring(titleFileFileName.lastIndexOf("."));
			StreamUtil.uploadActiveImgs(titleFile, getWebAppsRealPath()
					+ imgAbsolutePath + pictureName);
			/*FileUploadUtil.compressPic(getWebAppsRealPath()
					+ imgAbsolutePath + pictureName, titleFile, imgWidth, imgHeight);*/
			filePath = imgAbsolutePath + pictureName;
		}
		if (titleFile != null) {
			// 文件路劲
			contentTab.setVarContentImgUrl((filePath).replace("\\", "/"));
		}
		// 内容图片库处理
		contentImgProcess();

		// 处理下载信息 downLoadDto
		// 文件上櫥绝对路径
		// 处理下载信息 downLoadDto
		if (downLoadDto != null) {
			// 文件上櫥绝对路径
			ContentImgTab imgTab = new ContentImgTab();
			if (downLoadDto.getUploadFile() != null) {

				String imgAbsolutePath = getImgBasePath()
						// + ImgAndFilePath.ENTERP_ANDROID
						+ ImgAndFilePath.ENTERP_CATELOG
						+ ImgAndFilePath.ENTERP_DETAIL + File.separator;
				String pictureName = FileUploadUtil.generateIconName() + ".jpg";
				/*FileUploadUtil.compressPic(getWebAppsRealPath() + imgAbsolutePath
						+ pictureName, downLoadDto.getUploadFile(),
						GenericConstants.CONTENT_DETAIL_IMG_WIDTH, 0);*/
				StreamUtil.uploadActiveImgs(downLoadDto.getUploadFile(),
						getWebAppsRealPath() + imgAbsolutePath + pictureName);
				// + contentImgDto.getUploadFileFileName());
				filePath = imgAbsolutePath + pictureName;
				imgTab.setVarImgUrl((filePath).replace("\\", "/"));
			}
			if (downLoadDto.getDownloadUrl() != null
					&& !"".equals(downLoadDto.getDownloadUrl())
					&& downLoadDto.getIosUrl() != null
					&& !"".equals(downLoadDto.getIosUrl())) {

				imgTab.setVarImgName(downLoadDto.getDownloadUrl() + ","
						+ downLoadDto.getIosUrl());
				// -1 代表这是下载的地址
				imgTab.setVarImgDescrip("-1");
				imgTab.setIntType(4);
				imgTab.setIntImgId(downLoadDto.getIntImgId());
				// 文件描述
				imgList.add(imgTab);
			}
		}

		String deletedImgIds = request.getParameter("deletedImgIds");

		appContentService.updateContentDetail(intContentId, contentTab,
				imgList, attList, deletedImgIds);

		return SUCCESS;
	}

	private void contentImgProcess() throws IOException {
		imgList = new ArrayList<ContentImgTab>();
		if (contentImg != null && contentImg.size() > 0) {
			ContentImgTab imgTab = null;

			ContentImgDto contentImgDto = null;
			Image img = null;
			for (int i = 0; i < contentImg.size(); i++) {
				imgTab = new ContentImgTab();
				contentImgDto = contentImg.get(i);
				if (contentImgDto == null)
					continue;
				if (!StringUtils.isBlank(contentImgDto.getDownloadImgUrl()) && contentImgDto.getDownloadImgUrl().contains("WORKDIR/TEMP/")) {
					String srcFile = getWebAppsRealPath() + contentImgDto.getDownloadImgUrl().replace("/", File.separator);
					String newImgName = FilenameUtils.getName(contentImgDto.getDownloadImgUrl());
					if(contentImgDto.getIntType()==0){
						img = ImageIO.read(new File(srcFile));
						newImgName = FilenameUtils.getBaseName(contentImgDto.getDownloadImgUrl())+"_"+img.getWidth(null)+"x"+img.getHeight(null)+"."+FilenameUtils.getExtension(contentImgDto.getDownloadImgUrl());
						
					}
					String relatePath = getImgBasePath() + ImgAndFilePath.ENTERP_CATELOG + ImgAndFilePath.ENTERP_DETAIL + File.separator + newImgName;
					String targetPath = getWebAppsRealPath() + relatePath;
					FileUploadUtil.copy(srcFile, targetPath);
					new File(srcFile).delete();
					imgTab.setVarImgUrl(relatePath.replaceAll("\\\\", "/"));
				} 
				imgTab.setIntImgId(contentImgDto.getIntImgId());
				imgTab.setVarImgName(contentImgDto.getUploadFileFileName());
				imgTab.setVarImgDescrip(contentImgDto.getVarImgDescript());
				imgTab.setIntType(contentImgDto.getIntType());
				imgTab.setIntOrder(contentImgDto.getIntOrder());
				imgList.add(imgTab);
			}
		}
	}
	
	/**
	 * 检测内容是否被绑定
	 * @author Taylor
	 * 2012-9-7 上午10:13:46
	 * @return
	 * @throws IOException
	 * String
	 */
	public String checkIfContentIsBinded() throws IOException {
		boolean result = appContentService.checkIfContentBinded(intContentId);
		jsonOut(String.valueOf(result));
		return null;
	}

	/**
	 * 删除详情
	 * 
	 * @return
	 * @author zhangqiang 2012-8-6上午09:42:41
	 */
	public String goDelContentDetail() {
		boolean isBinded = Boolean.parseBoolean(request.getParameter("isBinded"));
		if( productId != null){
			ecProduceService.deleteProduct(productId, intContentId, isBinded);
		} else {
			appContentService.deleteContentDetail(intContentId,isBinded);
		}
		return null;
	}

	/**
	 * 复制详情
	 * 
	 * @return
	 * @author zhangqiang 2012-8-9下午01:52:02
	 */
	public String goCopyContent() {

		if (pageContent == null) {
			pageContent = new Pagination();

		}
		String intCateId = request.getParameter("intCateId");
		// 判断第一次进入分页信息
		if (getSelectPerPage("page1") == -1) {
			pageContent.setPageRecord(GenericConstants.PAGE_NO);
		} else {
			pageContent.setPageRecord(getSelectPerPage("pageContent"));
		}
		// 判断是否是第一次查询
		if (getQueryFlag("page1") == -1) {
			pageContent.setTotalRecord(appContentService.getCountById(
					intCateId, getUserInfo().getAppId()));
		} else {
			pageContent.setTotalRecord(getQueryFlag("pageContent"));
		}
		setPageParameters(pageContent, "pageContent");
		// 获取树的子节点信息
		appContentList = appContentService.getAppContentById(
				Integer.parseInt(intCateId), getUserInfo().getAppId(),
				pageContent.getCurrentPage(), pageContent.getPageRecord());
		if (appContentList != null && appContentList.size() > 0) {

			for (AppContentDto dto : appContentList) {
				dto.setVarContentImgUrl(getServerURL()
						+ dto.getVarContentImgUrl());
			}
		}
		return SUCCESS;

	}

	/**
	 * 处理复制的详情
	 * 
	 * @return
	 * @author zhangqiang 2012-8-9下午03:30:27
	 */
	public String doCopyContent() {

		// 分类ID TODO
		String intCateId = request.getParameter("intCateId");
		// 内容Id
		String contengCks = request.getParameter("contengCks");

		appContentService.saveCopyContentDetail(Integer.parseInt(intCateId),
				contengCks);
		return SUCCESS;
	}

	/**
	 * 应用内容管理的树结构json数据封装
	 * 
	 * @param catelogList
	 * @return
	 * @author zhangqiang 2012-7-8上午10:14:06
	 */
	private List<String> assembleAppContentTreeData(List<CatelogTab> catelogList) {
		// 请求数据并封装为JSON格式
		List<String> assemebledDataList = new ArrayList<String>();

		StringBuffer tempStr = null;
		if (null == catelogList) {
			tempStr = new StringBuffer();
			tempStr.append("{id:\"" + 1 + "\",pId:\"\", name:\"后台信息管理\"}");
			assemebledDataList.add(tempStr.toString());
		}
		for (CatelogTab catelogTab : catelogList) {
			tempStr = new StringBuffer();
			tempStr.append("{");
			tempStr.append("id: \"" + catelogTab.getIntCateId() + "\"");
			tempStr.append(", pId: \"" + catelogTab.getIntParentCateId() + "\"");

			tempStr.append(", name: \""
					+ catelogTab.getVarCateName().replaceAll("\"", "＂") + "\"");

			tempStr.append("}");
			assemebledDataList.add(tempStr.toString());
		}

		return assemebledDataList;
	}

	/**
	 * 后台信息管理的树结构json数据封装
	 * 
	 * @param orginalDataList
	 * @return
	 * @author zhangqiang 2012-7-8上午10:14:06
	 */
	private List<String> assembleTreeData(List<WebMenuTab> orginalDataList) {
		// 请求数据并封装为JSON格式
		List<String> assemebledDataList = new ArrayList<String>();

		StringBuffer tempStr = null;
		if (null == orginalDataList) {
			tempStr = new StringBuffer();
			tempStr.append("{id:\"" + 1 + "\",pId:\"\", name:\"后台信息管理\"}");
			assemebledDataList.add(tempStr.toString());
		}
		for (WebMenuTab webMenuTab : orginalDataList) {
			if(!checkIfDisplayModule(webMenuTab.getIntMenuId()))
				continue;
			tempStr = new StringBuffer();
			tempStr.append("{");
			tempStr.append("id: \"" + webMenuTab.getIntMenuId() + "\"");
			tempStr.append(", pId: \"" + webMenuTab.getIntParentMenuId() + "\"");

			tempStr.append(", name: \""
					+ webMenuTab.getVarMenuName().replaceAll("\"", "＂") + "\"");
			if (webMenuTab.getVarMenuLink() != null
					&& !"".equals(webMenuTab.getVarMenuLink())) {
				tempStr.append(", file: \""
						+ webMenuTab.getVarMenuLink().replaceAll("\"", "＂")
						+ "\"");
			}
			if (webMenuTab.getVarMenuTarget() != null
					&& !"".equals(webMenuTab.getVarMenuTarget())) {
				tempStr.append(", target: \""
						+ webMenuTab.getVarMenuTarget().replaceAll("\"", "＂")
						+ "\"");
			}
			tempStr.append("}");
			assemebledDataList.add(tempStr.toString());
		}

		return assemebledDataList;
	}
	
	/**
	 * 内容置顶
	 * @author Taylor
	 * 2012-11-25 下午01:47:53
	 * @return
	 * String
	 */
	public String doDataTop() {
		if( productId != null ){
			ecProduceService.topProductSortOrder(productId, Long.parseLong(intCateId));
		}
		contentService.topContentSortOrder(intContentId, Integer.parseInt(intCateId));
		return null;
	}
	
	/**
	 * 取消内容置顶
	 * @author Taylor
	 * 2012-11-25 下午04:38:49
	 * @return
	 * String
	 */
	public String doCancelDataTop() {
		if( productId != null ){
			ecProduceService.cancelProductTop(productId);
		}
		contentService.cancelContentTop(intContentId);
		return null;
	}
	
	/**
	 * 检测是否显示该模块
	 * @author Taylor
	 * 2012-11-10 下午02:44:43
	 * @param id
	 * @return
	 * boolean
	 */
	private boolean checkIfDisplayModule(int id) {
		if(id==108 && "false".equals(EhCacheManager.getObject(GenericConstants.MESSAGE_PUSH_MODULE_SHOW))){
			//消息推送
			return false;
		} else if(id==107 && "false".equals(EhCacheManager.getObject(GenericConstants.SHARE_MODULE_SHOW))){
			//分享管理
			return false;
		} else if(id==109 && "false".equals(EhCacheManager.getObject(GenericConstants.FAVORITE_MODULE_SHOW))){
			//收藏管理
			return false;
		} else if(id==111 && "false".equals(EhCacheManager.getObject(GenericConstants.USER_MANAGE_MODULE_SHOW))){
			//用户管理
			return false;
		}
		return true;
	}
	
	private long getShopObjectId(String fromUrl) {
		if("c".equals(fromUrl)){
			return GenericConstants.CATE_ID_PRE + Integer.parseInt(intCateId);
		}
		return GenericConstants.SHOP_ID_PRE + getUserInfo().getAppId();
	}
	
	private long getShopTargetId(String fromUrl) {
		if("c".equals(fromUrl)){
			return GenericConstants.CATE_ID_PRE + intShopId;
		}
		return GenericConstants.SHOP_ID_PRE + intShopId;
	}
	
	/**
	 * 获取门店的编辑信息
	 * 
	 * @return
	 * @author zhangqiaing 2012-7-18上午10:59:33
	 */
	public String getEditEnterShop() {
		String fromUrl = request.getParameter("fromUrl");
		if (intShopId == -1) {
			enterpShopTab = new EnterpShopTab();
			enterpShopTab.setUsedTags(enterpShopService.getUsefullTags(getShopObjectId(fromUrl)));
			if("c".equals(fromUrl)){
				initAddAttrs();
				catelogTab = catelogService.get(Integer.parseInt(intCateId));
				return "content";
			}
			return SUCCESS;
		}
		enterpShopTab = enterpShopService.get(intShopId);
		this.setIntCateId(enterpShopTab.getIntCateId().toString());
		List<Tags> used = enterpShopService.getUsedTags(getShopTargetId(fromUrl));
		List<Tags> all = enterpShopService.getUsefullTags(getShopObjectId(fromUrl));
		for (Tags tag : all) {
			for (Tags use : used) {
				if(tag.getId().longValue() == use.getId().longValue()){
					tag.setStatus(1);
					selectedTagsContainer += ","+tag.getId();
				}
			}
		}
		enterpShopTab.setUsedTags(all);
		enterpShopTab.setDatUpdateDatetime(selectedTagsContainer);
		if("c".equals(fromUrl)){
			this.setIntContentId(enterpShopTab.getIntContentId());
			initEditAttrs();
			initImgs();
			catelogTab = catelogService.get(enterpShopTab.getIntCateId());
			return "content";
		}
		return SUCCESS;
	}
	
	private void initShop() {
		enterpShopTab.setIntAppId(getUserInfo().getAppId());
		enterpShopTab.setIntEnterpId(getUserInfo().getIntEnterpId());
		enterpShopTab.setIntDeleteSign(GenericConstants.DELETE_SIGN_EXIST);
		enterpShopTab.setVarShopCountry("中国");
		enterpShopTab.setDatUpdateDatetime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
	}
	
	public String doShopSave() throws IOException {
		initShop();
    	String icon = enterpShopTab.getVarIconUrl();
    	String thumb = enterpShopTab.getVarThumbImg();
    	String newIcon = imgProcess(myFile, myFileFileName, enterpShopTab.getVarIconUrl());
    	String newThumb = imgProcess(titleFile, titleFileFileName, enterpShopTab.getVarThumbImg());
    	enterpShopTab.setVarIconUrl(newIcon);
    	enterpShopTab.setVarThumbImg(newThumb);
    	enterpShopTab.setIntCateId(Integer.parseInt(intCateId));
    	contentImgProcess();
    	enterpShopService.updateShop(enterpShopTab,getShopParams());
    	oldImgDelete(icon,newIcon);
    	oldImgDelete(thumb,newThumb);
		return SUCCESS;
	}
	
	private ShopPOJO getShopParams(){
		ShopPOJO params = new ShopPOJO();
		params.setAttList(attList);
		params.setContext(request.getContextPath());
		params.setDeletedImgIds(request.getParameter("deletedImgIds"));
		params.setDelTagsContainer(delTagsContainer);
		params.setImgList(imgList);
		params.setIntContentId(intContentId);
		params.setNewTagsContainer(newTagsContainer);
		params.setSelectedTagsContainer(selectedTagsContainer);
		params.setUserInfoDto(getUserInfo());
		params.setFrom("c");
		return params;
	}
	
	private String imgProcess(File file,String name,String oldImgUrl) {
		if (file != null) {
			String imgRelativePath = getImgBasePath() + ImgAndFilePath.SHOP + File.separator;
			String imgAbsolutePath = getWebAppsRealPath() + imgRelativePath;
			File folder = new File(imgAbsolutePath);
			if (!folder.exists()) {
				folder.mkdirs();
			}
			String fileName = name.substring(0,name.lastIndexOf("."))+ "_"+ FileUploadUtil.generateIconName()
					+ "." + FilenameUtils.getExtension(name);
			StreamUtil.uploadActiveImgs(file, imgAbsolutePath + fileName);
			return imgRelativePath.replaceAll("\\\\", "/")+fileName;
		}
		return oldImgUrl;
	}
	
	private void oldImgDelete(String oldImgUrl,String newImgUrl) {
		if (!StringUtils.isBlank(oldImgUrl) && !newImgUrl.equals(oldImgUrl)){
			File newFile = new File(getWebAppsRealPath() + oldImgUrl);
			if (newFile.exists()) {
				newFile.delete();
			}
		}
	}

	public File getMyFile() {
		return myFile;
	}

	public void setMyFile(File myFile) {
		this.myFile = myFile;
	}

	public String getMyFileFileName() {
		return myFileFileName;
	}

	public void setMyFileFileName(String myFileFileName) {
		this.myFileFileName = myFileFileName;
	}

	public String getIntCateId() {
		return intCateId;
	}

	public void setIntCateId(String intCateId) {
		this.intCateId = intCateId;
	}

	public CatelogTab getCatelogTab() {
		return catelogTab;
	}

	public void setCatelogTab(CatelogTab catelogTab) {
		this.catelogTab = catelogTab;
	}

	public List<CatelogTab> getCatelogList() {
		return catelogList;
	}

	public void setCatelogList(List<CatelogTab> catelogList) {
		this.catelogList = catelogList;
	}

	public List<AppContentDto> getAppContentList() {
		return appContentList;
	}

	public void setAppContentList(List<AppContentDto> appContentList) {
		this.appContentList = appContentList;
	}

	public Pagination getPage() {
		return page;
	}

	public void setPage(Pagination page) {
		this.page = page;
	}

	public Integer getIntContentId() {
		return intContentId;
	}

	public void setIntContentId(Integer intContentId) {
		this.intContentId = intContentId;
	}

	public ContentTab getContentTab() {
		return contentTab;
	}

	public void setContentTab(ContentTab contentTab) {
		this.contentTab = contentTab;
	}

	public List<AttributeDto> getAttList() {
		return attList;
	}

	public void setAttList(List<AttributeDto> attList) {
		this.attList = attList;
	}

	public List<ContentImgTab> getImgList() {
		return imgList;
	}

	public void setImgList(List<ContentImgTab> imgList) {
		this.imgList = imgList;
	}

	public List<CommentDto> getCommentList() {
		return commentList;
	}

	public void setCommentList(List<CommentDto> commentList) {
		this.commentList = commentList;
	}

	public List<AttributeTab> getAtList() {
		return atList;
	}

	public void setAtList(List<AttributeTab> atList) {
		this.atList = atList;
	}

	public File getTitleFile() {
		return titleFile;
	}

	public void setTitleFile(File titleFile) {
		this.titleFile = titleFile;
	}

	public String getTitleFileFileName() {
		return titleFileFileName;
	}

	public void setTitleFileFileName(String titleFileFileName) {
		this.titleFileFileName = titleFileFileName;
	}

	public List<PageModuleDetailDto> getPageList() {
		return pageList;
	}

	public void setPageList(List<PageModuleDetailDto> pageList) {
		this.pageList = pageList;
	}

	public List<AppDetailPageModuleTab> getPageMpoduleList() {
		return pageMpoduleList;
	}

	public void setPageMpoduleList(List<AppDetailPageModuleTab> pageMpoduleList) {
		this.pageMpoduleList = pageMpoduleList;
	}

	public List<ContentImgDto> getContentImg() {
		return contentImg;
	}

	public void setContentImg(List<ContentImgDto> contentImg) {
		this.contentImg = contentImg;
	}

	public String getModules() {
		return modules;
	}

	public void setModules(String modules) {
		this.modules = modules;
	}

	public Pagination getPageContent() {
		return pageContent;
	}

	public void setPageContent(Pagination pageContent) {
		this.pageContent = pageContent;
	}

	public ContentImgDto getDownLoadDto() {
		return downLoadDto;
	}

	public void setDownLoadDto(ContentImgDto downLoadDto) {
		this.downLoadDto = downLoadDto;
	}

	public ContentImgTab getDownLoadtab() {
		return downLoadtab;
	}

	public void setDownLoadtab(ContentImgTab downLoadtab) {
		this.downLoadtab = downLoadtab;
	}

	public List<AttributeListTab> getAttriListList() {
		return attriListList;
	}

	public void setAttriListList(List<AttributeListTab> attriListList) {
		this.attriListList = attriListList;
	}

	public int getImgWidth() {
		return imgWidth;
	}

	public void setImgWidth(int imgWidth) {
		this.imgWidth = imgWidth;
	}

	public int getImgHeight() {
		return imgHeight;
	}

	public void setImgHeight(int imgHeight) {
		this.imgHeight = imgHeight;
	}

	public int getImgSize() {
		return imgSize;
	}

	public void setImgSize(int imgSize) {
		this.imgSize = imgSize;
	}

	public List<AttributeAndOptionsDto> getLstAttrAndOpt() {
		return lstAttrAndOpt;
	}

	public void setLstAttrAndOpt(List<AttributeAndOptionsDto> lstAttrAndOpt) {
		this.lstAttrAndOpt = lstAttrAndOpt;
	}

	public String getClientRequestType() {
		return clientRequestType;
	}

	public void setClientRequestType(String clientRequestType) {
		this.clientRequestType = clientRequestType;
	}

	public EcProductDto getEcProductDto() {
		return ecProductDto;
	}

	public void setEcProductDto(EcProductDto ecProductDto) {
		this.ecProductDto = ecProductDto;
	}

	public List<EcProductDto> getProducts() {
		return products;
	}

	public void setProducts(List<EcProductDto> products) {
		this.products = products;
	}

	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public EnterShopDto getCondition() {
		return condition;
	}

	public void setCondition(EnterShopDto condition) {
		this.condition = condition;
	}

	public List<EnterShopDto> getShopList() {
		return shopList;
	}

	public void setShopList(List<EnterShopDto> shopList) {
		this.shopList = shopList;
	}

	public EnterpShopTab getEnterpShopTab() {
		return enterpShopTab;
	}

	public void setEnterpShopTab(EnterpShopTab enterpShopTab) {
		this.enterpShopTab = enterpShopTab;
	}

	public String getNewTagsContainer() {
		return newTagsContainer;
	}

	public void setNewTagsContainer(String newTagsContainer) {
		this.newTagsContainer = newTagsContainer;
	}

	public String getSelectedTagsContainer() {
		return selectedTagsContainer;
	}

	public void setSelectedTagsContainer(String selectedTagsContainer) {
		this.selectedTagsContainer = selectedTagsContainer;
	}

	public String getDelTagsContainer() {
		return delTagsContainer;
	}

	public void setDelTagsContainer(String delTagsContainer) {
		this.delTagsContainer = delTagsContainer;
	}

	public List<Tags> getUsedTags() {
		return usedTags;
	}

	public void setUsedTags(List<Tags> usedTags) {
		this.usedTags = usedTags;
	}

	public Integer getIntShopId() {
		return intShopId;
	}

	public void setIntShopId(Integer intShopId) {
		this.intShopId = intShopId;
	}

	public int getShowAll() {
		return showAll;
	}

	public void setShowAll(int showAll) {
		this.showAll = showAll;
	}

}
